﻿using Domain;
using Domain.Entity;
using Domain.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.AppService.RolesAppService
{
	public class RolesAppService : IRolesAppService
	{
		private readonly IRolesRepository rolesRepository;

		public RolesAppService(IRolesRepository rolesRepository)
        {
			this.rolesRepository = rolesRepository;
		}

		public Task<List<Roles>> GetRoles()
		{
			return rolesRepository.GetRoles();
		}

		public Task<Roles> GetRolesById(int uid)
		{
			return rolesRepository.GetRolesById(uid);
		}

		public Task<bool> RolesAdd(Roles roles)
		{
			return rolesRepository.RolesAdd(roles);
		}

		public RolesFenYe RolesData(int page, int pageSize)
		{
			return rolesRepository.RolesData(page, pageSize);
		}

		public Task<bool> RolesDelete(int id)
		{
			return rolesRepository.RolesDelete(id);
		}

		public Task<bool> RolesUpDate(Roles roles)
		{
			return rolesRepository.RolesUpDate(roles);
		}
	}
}
